/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package rg1linedemo;

/**
 *
 * @author apple
 */
public class Line {
    
    private Point startPoint;
    private Point endPoint;
    
    public Line()
    {
        
    }
    
    public Line(Point startPoint,Point endPoint)
    {
        this.startPoint=startPoint;
        this.endPoint=endPoint;
    }
    
    public Point getStartPoint()
    {
        return this.startPoint;
    }
    
    public void setStartPoint(Point startPoint)
    {
        this.startPoint=startPoint;
    }
    
    public Point getEndPoint()
    {
        return this.endPoint;
    }
    
    public void setEndPoint(Point endPoint)
    {
        this.endPoint=endPoint;
    }
    
    public double getLength()
    {
        double temp=(this.startPoint.getX()-this.endPoint.getX())*(this.startPoint.getX()-this.endPoint.getX())
                +(this.startPoint.getY()-this.endPoint.getY())*(this.startPoint.getY()-this.endPoint.getY());
        return Math.sqrt(temp);
    }
    
}
